package cn.itcast.zt.java8.cut_point;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.Map;
import java.util.TreeMap;

/**
 * 携带分组以及自动化放量规则
 * @author zhangtian105
 * @date 2024/1/15
 * @apiNote
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class BaseGoupReleaseCutPoint implements Serializable {
    private static final long serialVersionUID = -1345602663076219997L;
    /**
     * groupReleaseTimeCutPoint结构中的key表示同类型的分组，默认分组：default(根据业务类型划分不同的分组key值，单独执行切量逻辑)
     * TreeMap<Long, BaseCutPoint> 自动放量节奏 其中key表示是时间切量戳，根据时间戳自动化控制放量节奏，时间戳与当前时间比较确认切量与放量的区间
     */
    private Map<String, TreeMap<String, BaseCutPoint>> groupReleaseTimeCutPoint ;
}
/**
 * 结构如下: 如果客户端可见 则暴露给客户端应该是分组key的值，如：default_1: true, default_2: false
  {
     "default_1": {
         "1000": {
           "client": "android,apple,wh5" ,
           "onlyForServer": true ,
           "clientVersionStart": "12.2.0" ,
           "clientVersionEnd": "12.3.4" ,
           "percentStart": 0 ,
           "percentEnd": 10
         },
         "1002": {
           "client": "android,apple,wh5" ,
           "onlyForServer": false ,
           "clientVersionStart": "12.3.4" ,
           "clientVersionEnd": "" ,
           "percentStart": 0 ,
           "percentEnd": 20
         }
     },
     "default_2": {
         "1000": {
           "client": "android,apple,wh5" ,
           "onlyForServer": true ,
           "clientVersionStart": "12.2.0" ,
           "clientVersionEnd": "12.3.4" ,
           "percentStart": 0 ,
           "percentEnd": 10
         },
         "1002": {
           "client": "android,apple,wh5" ,
           "onlyForServer": false ,
           "clientVersionStart": "12.3.4" ,
           "clientVersionEnd": "" ,
           "percentStart": 0 ,
           "percentEnd": 20
         }
     }
  }
 */